<?php 
class User_add extends CI_Controller  {
	function __construct()
 {
  	parent::__construct();
	$this->load->model('TB_Menu');
 }
	function index()
	{
	 
		$Data["TypeList"]=$this->TB_Menu->get_Menus();
		if($_GET["sign"]=="add")
		{
			$Data["sign"]="user/insert";
		//	$temparr[0]=array("aa"=>(array("Title"=>"","NewsSource"=>"","OrderNum"=>"","Content"=>"")));
			$temparr[0]['UserID']=0;
			$temparr[0]['UserName']="";
			$temparr[0]['Password']="";
			$Data["UserEntity"]=$temparr;
		}
		else
		{
			$Data["sign"]="user/update";
			$this->load->model('TB_User');
			$Data["temp"]=$this->TB_User->GetUserByID($_GET["UserID"]);
			$temparr[0]['UserID']=$_GET["UserID"];
			$temparr[0]['UserName']=$Data["temp"][0]->UserName;
			$temparr[0]['Password']=$Data["temp"][0]->Password;
			$Data["UserEntity"]=$temparr;
		}
		$this->load->view('Add_user',$Data);
	}
}